<?
if($_POST[type]=='candidate'){
	//print_r($_POST);
	if($_POST[flag]=="1"){
			$url = "http://feeds.reuters.com/reuters/technologyNews";
			$str = @file_get_contents($url);

			@preg_match_all( '|		<title>(.*)</title>|U' , $str , $title);
			@preg_match_all( '|		<link>(.*)</link>|U'   , $str , $link);

			for($i=0;$i<10;$i++){
			   $rss[$i][title]   = $title[1][$i];
			   $rss[$i]['link']  = $link[1][$i]; 
			    if($rss[$i][title]!=''){
			   echo "<li><a href='".$rss[$i]['link']."' target='_blank'>".$rss[$i][title]."</a></li>";
				}
			}	
			exit;
	}
	if($_POST[flag]=="2"){
		/*
			$url = "http://online.barrons.com/xml/rss/3_7516.xml";
			$str = @file_get_contents($url);

			@preg_match_all( '|	   <title>(.*)</title>|U' , $str , $title);
			@preg_match_all( '|	   <link>(.*)</link>|U'   , $str , $link);

			for($i=0;$i<10;$i++){
			   $rss[$i][title]   = $title[1][$i];
			   $rss[$i]['link']  = $link[1][$i]; 
			    if($rss[$i][title]!=''){
			   echo "<li><a href='".$rss[$i]['link']."' target='_blank'>".$rss[$i][title]."</a></li>";
				}
			}	
			exit;
			*/
			$url = "http://feeds.reuters.com/reuters/businessNews";
			$str = @file_get_contents($url);

			@preg_match_all( '|		<title>(.*)</title>|U' , $str , $title);
			@preg_match_all( '|		<link>(.*)</link>|U'   , $str , $link);

			for($i=0;$i<10;$i++){
			   $rss[$i][title]   = $title[1][$i];
			   $rss[$i]['link']  = $link[1][$i]; 
			    if($rss[$i][title]!=''){
			   echo "<li><a href='".$rss[$i]['link']."' target='_blank'>".$rss[$i][title]."</a></li>";
				}
			}	
			exit;
	}
}
if($_POST[type]=='recruiter'||$_POST[type]=='advisor'){
	//print_r($_POST);
	if($_POST[flag]=="1"){
			$url = "http://feeds.reuters.com/reuters/businessNews";
			$str = @file_get_contents($url);

			@preg_match_all( '|		<title>(.*)</title>|U' , $str , $title);
			@preg_match_all( '|		<link>(.*)</link>|U'   , $str , $link);

			for($i=0;$i<10;$i++){
			   $rss[$i][title]   = $title[1][$i];
			   $rss[$i]['link']  = $link[1][$i]; 
			    if($rss[$i][title]!=''){
			   echo "<li><a href='".$rss[$i]['link']."' target='_blank'>".$rss[$i][title]."</a></li>";
				}
			}	
	}
	if($_POST[flag]=="2"){
		//http://feeds.reuters.com/reuters/technologyNews
			$url = "http://feeds.reuters.com/reuters/technologyNews";
			$str = @file_get_contents($url);

			@preg_match_all( '|		<title>(.*)</title>|U' , $str , $title);
			@preg_match_all( '|		<link>(.*)</link>|U'   , $str , $link);

			for($i=0;$i<10;$i++){
			   $rss[$i][title]   = $title[1][$i];
			   $rss[$i]['link']  = $link[1][$i]; 
			    if($rss[$i][title]!=''){
			   echo "<li><a href='".$rss[$i]['link']."' target='_blank'>".$rss[$i][title]."</a></li>";
				}
			}	
			exit;
	}
}
/*
if($_POST[type]=='employer'){
	//print_r($_POST);
	if($_POST[flag]=="1"){
			$url = "http://www.shrm.org/shrmnewsfeeds/createmyfeedjs.asp?category=m&nchannel=m&width=100&maxarticles=5&xchannel=Headlines&TitleFontSize=1";
			$rss1 = @file_get_contents($url);
			$a1  = array('/(<\/?)(TABLE|table|tbody|TBODY|td|tr|TD|TR|TR|font|B|b|br|BR\w+)([^>]*>)/i','/(<p)(.*)(p>)/i','/(<a)(.*)(\/a>)/i','/(document\.write\(\')(.*)(\'\);)/');
			$a2  = array('','','<li>\1\2\3</li>','\2');
			$rssp1 = stripslashes(preg_replace($a1,$a2,$rss1));
			echo $rssp1;
	}
	if($_POST[flag]=="2"){
			$url2 = "http://www.shrm.org/shrmnewsfeeds/createmyfeedjs.asp?category=global&nchannel=global&width=100&maxarticles=5&xchannel=headlines&TitleFontSize=1";
			$rss2 = @file_get_contents($url2);
			$a1  = array('/(<\/?)(TABLE|table|tbody|TBODY|td|tr|TD|TR|TR|font|B|b|br|BR\w+)([^>]*>)/i','/(<p)(.*)(p>)/i','/(<a)(.*)(\/a>)/i','/(document\.write\(\')(.*)(\'\);)/');
			$a2  = array('','','<li>\1\2\3</li>','\2');
			$rssp2 = stripslashes(preg_replace($a1,$a2,$rss2));

			echo $rssp2;
			exit;
	}
}
*/
if($_POST[type]=='employer'){
	if($_POST[flag]=="1"){
			$url = "http://feeds.reuters.com/reuters/businessNews";
			$str = @file_get_contents($url);

			@preg_match_all( '|		<title>(.*)</title>|U' , $str , $title);
			@preg_match_all( '|		<link>(.*)</link>|U'   , $str , $link);

			for($i=0;$i<10;$i++){
			   $rss[$i][title]   = $title[1][$i];
			   $rss[$i]['link']  = $link[1][$i]; 
			    if($rss[$i][title]!=''){
			   echo "<li><a href='".$rss[$i]['link']."' target='_blank'>".$rss[$i][title]."</a></li>";
				}
			}	
	}
	if($_POST[flag]=="2"){
			$url = "http://hbswk.hbs.edu/rss/rss.xml";
			$str = @file_get_contents($url);
            //<title><![CDATA[Shamed and Able: How Firms Respond to Information Disclosure]]></title>
			@preg_match_all( '|<title><!\[CDATA\[(.*)\]\]></title>|U' , $str , $title);
			@preg_match_all( '|\]\]></title>\n<link>(.*)</link>|U'   , $str , $link);

			for($i=0;$i<10;$i++){
			   $rss[$i][title]   = $title[1][$i];
			   $rss[$i]['link']  = $link[1][$i]; 
			    if($rss[$i][title]!=''){
			   echo "<li><a href='".$rss[$i]['link']."' target='_blank'>".$rss[$i][title]."</a></li>";
				}	
			}	
			exit;
	}
}
?>